<{include file="../common/iframe_head.tpl"}>
<link href="/css/uploadify.css" rel="stylesheet">
<script src="/js/jquery.uploadify.min.js"></script>
<form name='myForm1' id='myForm1' method='post' action='/benchmark/dosuggest'>
    <div style='margin:10px;'>
        <table>
            <tr><td><b>题目：</b></td><td><b><{$subject_info.question_num}><{$subject_info.title}></b></td></tr>
            <tr>
                <td>建议：</td>
                <td><textarea id="suggestion" name="suggestion" cols='65' rows='12'><{$info.suggestion}></textarea></td>
            </tr>
            <tr><td colspan='2'><input type='submit' class="button" value='提交'></td></tr>
        </table>
            <input type='hidden' name='subject_id' value='<{$subject_id}>' />
        <input name='nq_id' type='hidden' value='<{$nq_id}>' />
        <input type="hidden" name="qb_id" value="<{$info.qb_id}>"
    </div>
</form>
    <script>
        $(document).ready(function() {     
                var options = {         
                    beforeSubmit:  showRequest,  
                    success:       showResponse,
                    dataType:  'json'
                }
                $('#myForm1').ajaxForm(options);    
        });
            function showRequest(formData, jqForm, options) { 
                var suggestion = $('#suggestion').val();
                if (suggestion=='') {
                    alert('建议不能为空');
                    return false;
                }
                return true;
            }
            function showResponse(responseText, statusText, xhr, $form)  { 
                alert(responseText.note);
                if (responseText.status==1) {
                    window.parent.thisPage = false;
                    //window.parent.location.reload();
                    <{if $iframe==1}>
                    window.parent.location.reload();
                    <{else}>
                    window.parent.location.href='<{$referer}>&subject_id=<{$subject_info.subject_id}>';
                    <{/if}>
                }    
            }
    </script>